package com.web.exiaodao.remote.service;

import com.web.exiaodao.business.entity.*;
import com.web.exiaodao.remote.vo.ShopCarVo;
import com.web.exiaodao.remote.vo.ShopVo;
import com.web.webstart.base.service.ApiBaseService;
import com.web.webstart.base.util.result.XaResult;
import com.web.webstart.base.exception.BusinessException;

import java.util.List;
import java.util.Set;


public interface ApiShopService extends ApiBaseService<ShopVo, Shop> {

    /**
     * 获取商品信息
     * @param shopId 商品id 必传
     * @param userId 用户id 可选
     * @return
     * @throws BusinessException
     * @date 2016/12/20 下午2:0
     * @author duandazhi
     */
    public XaResult<ShopVo> findShopDetail(Long shopId, Long userId) throws BusinessException;

    /**
     * 验证商品信息(1:商品 2:库存 3:规格)
     * @param shopCars
     * @param isVip 是否是vip用户
     * @return 返回商品id的集合
     * @throws BusinessException
     */
    public XaResult<Set<Long>> validateShopInfo(List<ShopCarVo> shopCars, boolean isVip) throws BusinessException;


    /**
     * 批量,取消订单的时候,归还商品的库存
     * @param orderDetails 该订单号对应的订单详情
     * @return
     * @throws BusinessException
     */
    public XaResult<List<Shop>> updateShops(List<OrderDetail> orderDetails) throws BusinessException;
}
